<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('订单列表')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>订单编号：<input type="text" name="orderId" />
							</li>
							<li>SEID：<input type="text" name="seId" />
							</li>
							<li>订单类型： <select name="orderType"
								th:with="type=${@dict.getType('bussiness_orderType')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
										th:value="${dict.dictValue}"></option>
							</select>
							</li>
							<li>订单状态： <select name="orderStatus"
								th:with="type=${@dict.getType('bussiness_orderStatus')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
										th:value="${dict.dictValue}"></option>
							</select>
							</li>
							<li class=" " data-type="datetime"><label>创建时间： </label> <input
								type="text" readonly="readonly" placeholder="开始时间"
								name="startTime" id="startTime" /> <span>-</span> <input
								type="text" readonly="readonly" placeholder="开始时间"
								name="endTime" id="endTime" /></li>

							<li>
							<li><a class="btn btn-primary btn-rounded btn-sm"
								onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i
									class="fa fa-refresh"></i>&nbsp;重置</a> <script
									type="text/javascript">
							function reset(){
								$.form.reset();
								$.table.search();
							}
								</script></li>
						</ul>
					</div>
				</form>
			</div>

			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script th:inline="javascript">
		var datas_orderType = [[${@dict.getType('bussiness_orderType')}]];
		var datas_orderStatus = [[${@dict.getType('bussiness_orderStatus')}]];
        var prefix = ctx + "bussiness/orders";
        $(function() {
            var options = {
                url: prefix + "/list",
                modalName: "订单",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'orderId', 
					title : '订单编号',
				},	{
					field : 'seId', 
					title : 'SEID',
					sortable: false
				},{
					field : 'cardNo', 
					title : '卡号',
					sortable: false,
					visible: false
				},
				{
					field : 'merchantId', 
					title : '商户号',
					sortable: false
				},
				{
					field : 'orderType', 
					title : '订单类型',
					sortable: false,
					formatter : function(value) {
		            	return $.table.selectDictLabel(datas_orderType, value);
					}
				},
				{
					field : 'orderStatus', 
					title : '订单状态',
					sortable: false,
					formatter : function(value) {
		            	return $.table.selectDictLabel(datas_orderStatus, value);
					}
				},
				
				{
					field : 'tradeAtc', 
					title : '交易计数器',
					sortable: false,
					visible: false

				},
				{
					field : 'tranDateTime', 
					title : '充值交易日期时间',
					sortable: false,
					visible: false

				},	{
					field : 'payAmount', 
					title : '支付金额(分)',
					sortable: false
				},
				{
					field : 'rechargeAmount', 
					title : '充值金额(分)',
					sortable: false
				},
				{
					field : 'opencardAmount', 
					title : '开卡金额(分)',
					sortable: false
				},
				{
					field : 'totalAmount', 
					title : '总金额(分)',
					sortable: false
				},
				{
					field : 'createTime', 
					title : '创建时间',
					sortable: true
				},
				{
					field : 'updateTime', 
					title : '更新时间',
					sortable: true
				},
			
				{
					field : 'tradeNo', 
					title : '充值系统返回的充值流水号',
					visible: true

				} ]
            };
            $.table.init(options);
        });
    </script>
	<th:block th:include="include :: datetimepicker-css" />
	<th:block th:include="include :: datetimepicker-js" />
	<script type="text/javascript">
$('#startTime').datetimepicker({
    language : 'zh-CN',
    format : "yyyy-mm-dd HH:mm:ss",
    minView : 2,
    autoclose : 1,
    startView : 3,
});
$('#endTime').datetimepicker({
    language : 'zh-CN',
    format : "yyyy-mm-dd HH:mm:ss",
    minView : 2,
    autoclose : 1,
    startView : 3,
});
</script>
</body>
</html>